/*
 * glShadow.h
 *
 *  Created on: 28.10.2012
 *      Author: Martin
 *
 *      shadows on the scene
 */

#pragma once

#include "../ShaderPool.h"
#include <GL/gl.h>
#include "GL/glu.h"
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <iostream>
#include "../scene/World.h"
#include "../engine/engineSettings.h"

#define SHADOW_MAP_SIZE 2048

class glShadow
{
public:
	glShadow(int _mapSize, // size of terrain
			float _step); // step size of terrain
	virtual ~glShadow();

	void glShadowBegin(); // before drawing shadow
	GLuint glShadowEnd(); // after drawing shadow, return shadow texture

private:
	// Z values will be rendered to this texture when using fboId framebuffer
	GLuint depthTexture;
	// Hold id of the framebuffer for light POV rendering
	GLuint FramebufferName;

	// size of terrain
	int mapSize;
	// size of step between vertices in terrain
	float step;
};
